<?php

use think\migration\Seeder;

class StudentChapterRelationTableSeeder extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $rows = [];
        for($i = 1; $i <= 25; $i ++ ){
            $rows[] = [
                'student_id' => 1,
                'chapter_id' => $i,
                'is_lock' => mt_rand(0,1),
                'is_complete' => mt_rand(0,1),
                'create_time' => date('Y-m-d H:i:s'),
                'update_time' => date('Y-m-d H:i:s'),
            ] ;
        }
        $this->table('student_chapter_relation')->insert($rows)->save();
    }
}